export default defineNuxtRouteMiddleware((to, from) => {
  let passPath = ["/", "/login", "/about", "/index", "/myError"];
  if (!passPath.includes(to.path)) {
    let token = useUserStore().getToken();
    console.log(token, "text.globaltext.globaltext.globaltext.global");
    if (!token) {
      // ElMessage.error("请先登录");
      return navigateTo({
        path: "/login",
        query: { code: 401, message: "请先登录" },
      });
    }
  }
});
